//
//  NSURL+lvfj.m
//  lvfj
//
//  Created by lvfeijun on 2021/12/13.
//  Copyright © 2021 Goudu KuaiEx Technology(Shenzhen)Co.,ltd. All rights reserved.
//

#import "NSURL+lvfj.h"

@implementation NSURL (lvfj)
/// 解决 url 地址有中文返回nil
+(NSURL *)getURL:(NSString *)urlStr{
    [[NSURL alloc]initWithString:[urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
}
//[NSURL URLWithString:[userModel.faceUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]

#pragma mark 重写url初始化方法
+(instancetype)URLWithString:(NSString *)URLString{
    return [self getURL:URLString];
}
- (instancetype)initWithString:(NSString *)URLString{
    if (self = [super init]) {
        self = [self.class getURL:URLString];
    }
    return self;
}
@end
